Like companion and nested objects, nested classes have access to private properties and functions of their outer class. So, in this case, Bar has access to private things in Foo, such as Data.VALUE.

You can learn more about this in:
Run Edit